<?php
/**
 * file table
 * name size extenstion create_time path user_id
 *
 */
namespace backend\models;

use Yii;
use yii\db\ActiveRecord;

class Files extends ActiveRecord{
	public function scenarios(){
	    return [
	        'create' => ['name', 'size', 'extension', 'path', 'create_time', 'uid'],
	        'update' => ['name', 'size', 'extension', 'path', 'create_time', 'uid'],
	    ];
	}
	public function rules(){
		return [
			[['name', 'size', 'extenstion', 'path', 'create_time', 'uid'], 'required',],
			['name', 'string', 'max' => 50, 'min' => 1,],
			['extenstion', 'in', 'range' => ['jpg', 'png']],
			['path', 'string', 'max' => 50, 'min' => 1,],
		];
	}
}